home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
CRS
/
crs55.d81
/
planes.fil
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2009-10-10
|
11KB
|
334 lines
1 GOTO910
2 REM ** ML STOP KEY DISABLE **
3 PRINT"x[169]=[141][169][141]X` [234][255][169][255][133][145]L4[234]x[169]1[141][169][234][141]X`
4 [153]"xhhh+hNOThhhhhhhPRINT#HRUNHX`111"
5 [153]"hhhhhhh`1"
6 [143] ** 4 - POP ML SUBROUTINE **
10 [143] **GENERAL INPUT ROUTINE **
15 :
30 :
35 [143] +++ INPUT SECTION +++
40 [151]UO,0:UR$[178]"":UI$[178]""
42 [139]UL[178]0[167]UL[178]80
45 [153]" CMDCMD";:[151]UC,0
50 [161]UI$:[139]UI$[178]""[167]50
55 [139]UI$[178][199](13)[175][195](UR$)[177][178]1[167][151]UC,1:[153]" CMD";:[137]85
60 [139]UI$[178][199](20)[167]105
62 [139] [195](UR$)[178][177]UL[167]50
65 [141]120:[143] CHECK FOR VALID CHARACTER
70 UR$[178]UR$[170]UI$
75 [153]UI$;
80 [137]50
85 [143] +++ CHECK FOR HELP REQUEST +++
90 [139]UR$[178]UX$[167]195:[143] EXIT TO HELP ROUTINE
95 [139]UF[178]1[167][141]240
100 UF[178]0:[153]:[142]
102 [143] ++ CHECK DELETE ++
105 [139][195](UR$)[179]1[167]50
110 UR$[178][200](UR$,[195](UR$)[171]1)
115 [153]"CMD CMDCMD";:[137]50
120 [143] ++ CHECK FOR VALID CHARACTERS ++
125 [139][195](US$)[178]0[167]150
130 [129]US[178]1[164][195](US$)
135 [139]UI$[178][202](US$,US,1)[167][142]
140 [130]
145 UI$[178]"":[142]
150 [143] ** STANDARD INPUT **
152 [139][198](UI$)[178]46[167][142]
155 [139]UI$[178][199](32)[167][142]
160 [139][198](UI$)[179]48[176][198](UI$)[177]57[167]170
165 [142]
170 [139][198](UI$)[179]65[176][198](UI$)[177]90[167]180
175 [142]
180 [139][198](UI$)[179]193[176][198](UI$)[177]218[167]UI$[178]"":[142]
185 [139][194](UT)[178]UU%[167]UI$[178][199]([198](UI$)[171]128):[142]
187 [142]
190 UI$[178]"":[142]
195 UF[178]1:[143] +++ HELP ROUTINE EXIT +++
197 [141]250
200 [141]245
205 [129]UQ[178]UB[164](U2%[172]256[170]U1%[170]U3%[171]2)
210 UQ%(UQ[171]UB)[178][194](UQ):[130]:[153]"LOAD"
215 UZ[178]1:UV%[178][194](UT)
216 [137]300
217 UZ[178]0:US$[178]UJ$:UG$[178]UK$:UP[178]UJ:UL[178]UK
218 [139][194](50003)[178]0[167][151]53281,1:[153]"LOAD";:[151]53281,6:[151]53280,14:[137]220
219 [153]"LOAD";
220 UT$[178]UL$:[151]UT,UV%:[129]UQ[178]UB[164](U2%[172]256[170]U1%[170]U3%[171]3)
225 [151]UQ,UQ%(UQ[171]UB):[130]
230 [151]U1,U1%
232 [151]U2,U2%
233 [151]U4,U4%
234 [151]U3,U3%[171]1
235 [137]35
240 UD%[178]((U2%[172]256[170]U1%[170]U3%)[171]UB)[173]40:[153][200](UD$,UD%[170]1):[142]
245 [153][200](UD$,24);" HELP COMING WAIT ":[142]
250 U1%[178][194](U1):U2%[178][194](U2):U3%[178][194](U3):U4%[178][194](U4)
251 UJ$[178]US$:UK$[178]UG$:UL$[178]UT$:UJ[178]UP:UK[178]UL
255 [142]
300 [143] ** MENU **
301 :
302 [153]"LOAD":[151]UT,UU%:[139][194](50003)[178]0[167][151]53281,9:[151]53280,8
303 :
305 [153]" MENU"
310 [153]" --------------------------------------"
315 [153]" 1. BEGIN PLANES"
320 [153]" 2. STUDENT INSTRUCTIONS"
325 [153]" 3. TEACHER INSTRUCTIONS"
335 [153]" 4. QUIT"
340 [153]" --------------------------------------"
345 [153]" PRESS A NUMBER KEY (1-4) ";
350 UL[178]1:US$[178]"1234":[141]35:[143] INPUT ROUTINE
352 US$[178]""
355 [145][197](UR$)[141]1000,400,500,396
360 [137]300
395 [143] ** RE-ENABLE STOP KEY AND END **
396 [139][194](50003)[179][177]1[175][194](50003)[179][177]160[175][194](50003)[179][177]0[167]399
397 [158]UU[170]71:[139][194](50003)[178]0[167][151]53281,6:[151]53280,14
398 [153]"CONTLOAD":[128]
399 [141]875:[142]
400 [143] ** STUDENT INSTRUCTIONS **
405 [153]"LOAD":[151]UT,UL%:[139][194](50003)[178]0[167][151]53281,0:[151]53280,0
410 UH[178]1:UP[178]0:UG$[178]"(null)TUDENT RIGHT$NST":[141]850
415 [153]" (null)OU WILL SELECT THE OPTION ON WHICH"
416 [153]" YOU WISH TO BE DRILLED."
418 [153]" (null)OU WILL THEN BE ASKED FOR THE NUMBER"
420 [153]" OF QUESTIONS YOU WOULD LIKE TO ANSWER"
422 [153]" AND THE SKILL LEVEL YOU WOULD LIKE."
424 [153]" (null)HE QUESTION(S) WILL BE GIVEN."
426 [153]" (null)OUR SCORE AND THE PERCENTAGE WILL"
428 [153]" FOLLOW."
435 [141]835
455 UH[178]1:[141]850
460 [153]" (null)OTE:"
463 [153]" (null)EMEMBER TO PUT EQUATIONS IN"
464 [153]" THE FORM: AX+BY+CZ+D=0."
465 [153]" (null)O ADVANCE FROM ONE QUESTION"
470 [153]" TO THE NEXT PRESS THE (null)(null)ATNLENVAL BAR."
475 [153]"RIGHT$F AT ANY TIME YOU WISH TO RETURN"
480 [153]" TO THE (null)VAL(null)(null) PRESS H (null)VAL(null)(null)(null)(null)."
485 [141]835
490 [139]UZ[178]1[167][158]UP%:[137]217
499 [142]
500 [143] ** TEACHER INSTRUCTIONS **
501 [153]"LOAD":[151]UT,UL%:[139][194](50003)[178]0[167][151]53281,2:[151]53280,10
502 UH[178]1:UP[178]0:UG$[178]"(null)EACHER RIGHT$NST":[141]850
503 [153]" (null)O THE BEST OF OUR KNOWLEDGE,"
504 [153]" THIS PROGRAM IS IN THE PUBLIC"
505 [153]" DOMAIN. RIGHT$F THIS IS NOT THE CASE"
506 [153]" PLEASE CONTACT:"
507 [153]" LENOMMODORE PEEKUSINESS (null)ACHINES"
508 [153]" 3370 (null)HARMACY ATNVE.
509 PRINT" [193]GINCOURT, [207]NTARIO"
510 PRINT" [195]ANADA [205]1[215] 2[203]4"
511 PRINT" (416) 499-4292"
512 UH=1:UP=1:GOSUB 835:GOSUB 850:
513 PRINT" [208]ROGRAM [206]AME: [208]LANES
514 [153]" (null)RITTEN PEEKY : STR$. (null). LENOOPER
515 PRINT" [213]PGRADED [194]Y : [211]TEVE [199]UTZ
516 [153]" (null)HIS PROGRAM WILL RUN ON ANY
519 PRINT" [208][197][212] 64 [195][207][205][208][213][212][197][210]
520 [153]" LEN(null)(null)(null)(null)STR$(null)(null)VAL 64 LEN(null)(null)(null)(null)(null)VAL(null)
521 GOSUB835
590 IFUZ=1THENSYSUP%:GOTO217
599 RETURN
600 REM ** PROGRAM MODIFICATION INST **
601 PRINT"[147]":POKEUT,UL%
605 UH=1:UP=0:UG$="[208]ROGRAM [205]OD":GOSUB850
660 GOSUB835
690 IFUZ=1THENSYSUP%:GOTO217
699 RETURN
700 REM ** TO USE 8032 LOAD CBM4032 **
710 PRINT"[147]BEFORE RUNNING THIS PROGRAM ON AN 8032
720 [153]" LOAD THE 'CBM 4032' PROGRAM"
730 [158]UU[170]71
740 [128]
800 [143] ** T I T L E P A G E **
802 [153]"LOAD";:[151]UT,UU%:[139][194](50003)[178]0[167][151]53280,14:[151]53281,6
804 [129]I[178]1[164]38:[153]"SPC(WAIT";:[130]
806 [129]I[178]1[164]22:[153]"CMDSPC(WAIT";:[130]
808 [129]I[178]1[164]37:[153]"CMDCMDSPC(WAIT";:[130]
810 [129]I[178]1[164]22:[153]"ONCMDSPC(WAIT";:[130]
812 [153]"STEP WAIT
814 PRINT" [146] [146][169]
816 [153]" WAIT TAB((null)
818 PRINT"[223] [146]
820 [153]"C O M M O D O R E
822 PRINT"EDUCATIONAL
824 [153]"SOFTWARE
826 REM ** COMMODORE LOGO **
827 PRINTLEFT$(UD$,24);"PRESS SPACE BAR OR WAIT[146]":I=0
828 GETA$:IFA$<>" "THENI=I+1:IFI<250THEN828
830 T1$="":T2$="":T3$="":T4$="":I=0
832 GOTO300
835 REM ** SPACE BAR PRESS **
840 POKEUO,0:PRINTLEFT$(UD$,24);"PRESS SPACE BAR TO CONTINUE[146]"
844 GETUI$:IFUI$<>" "THEN844
846 RETURN
850 REM ** PAGE DESIGN ROUTINE **
852 UP=UP+1
855 PRINT"[147]"LEFT$(UT$+UP$,21);RIGHT$(UP$+UG$+STR$(UP),18)
860 PRINT" --------------------------------------"
864 IFUH<>0THEN870
865 PRINTLEFT$(UD$,24);LEFT$(UP$,7);"HELP - PRESS H <RETURN>"
870 UH=0:PRINT"":RETURN
875 REM ** PLEASE WAIT REMARK **
880 PRINTLEFT$(UD$,24);" ONE MOMENT PLEASE... "
885 RETURN
900 REM ** SET UP VARIABLES **
901 UX$="H":DIMUQ%(1000):UB=32768:U1=196:U2=197:U3=198:U4=216:UC=167:UU=1024
902 UT=59468:UU%=12:UL%=14:UP%=1146:UM=32768:UO=158:POKE 50003,0
903 IFPEEK(50003)=0THENUB=1024:U1=209:U2=210:U3=211:U4=214:UC=204:UU=2048
904 IFPEEK(50003)=0THENUT=53272:UU%=21:UL%=23:UP%=2139:UM=1024:UO=198
905 UD$=""
906 UP$=" "
907 UT$=" [208][204][193][206][197][211] [160][160][160][160][160][160]":REM PLACE PROGRAM TITLE HERE !!!!!!!!!!!!!!!!!***
908 RETURN
910 REM ** SET VARIABLES **
915 GOSUB900
920 REM ** CHECK FOR 8032 **
925 PRINT"[147]":PRINT"[160]":REM SHIFTED SPACE
930 IFPEEK(UB+40)<>96THENGOSUB700
931 REM ** MEMORY CHECK **
932 IF FRE(0)>2000THEN937
933 PRINT"[147]THIS MACHINE DOES NOT HAVE ENOUGH"
934 PRINT"MEMORY TO RUN THIS PROGRAM !"
935 SYSUU+71
936 END
937 PRINT"[147]":IFPEEK(50003)=0THEN962
940 REM ** BASIC 2.0 OR 4.0 OR C-64 SETUP **
941 POKE1075,133:POKE1076,144:POKE1077,234:POKE1079,4:POKE1080,133:POKE1081,145
942 POKE1091,155:POKE1098,133:POKE1099,144:POKE1100,234:POKE1103,133
943 POKE1104,145:POKE1105,234:POKE1082,234
945 IFPEEK(50003)<>160THEN955
950 POKE1093,88:POKE1094,228:POKE1097,85:POKE1102,228:GOTO965
955 IFPEEK(50003)<>1THEN990
960 POKE1093,49:POKE1094,230:POKE1097,46:POKE1102,230:GOTO965
962 POKE2099,141:POKE2100,20:POKE2101,3:POKE2103,8:POKE2104,141:POKE2105,21
963 POKE2106,3:POKE2115,145:POKE2117,52:POKE2118,234:POKE2121,49:POKE2122,141
964 POKE2123,20:POKE2124,3:POKE2126,234:POKE2127,141:POKE2128,21:POKE2129,3
965 SYSUU+48:REM DISABLE STOP KEY
970 GOSUB800:REM TITLE
980 GOTO300:REM MENU
990 PRINT"[147]THE PGM WILL NOT WORK ON THIS MACHINE!":END
1000 IFUZ=1THENSYSUP%:SYSUP%:UZ=0:REM ** PROGRAM STARTS HERE **
1001 PRINT"[147]";:RESTORE:IFPEEK(50003)=0THENPOKE53281,6:POKE53280,14
1010 UG$="":POKEUT,UL%
1020 DEFFNR(N)=-N+INT((2*N+1)*RND(TI))
1030 L4$="0123456789H"
1031 NC=0:HM=0
1040 Q$(1)="[198]IND THE EQUATION OF THE PLANE"
1080 UG$="":GOSUB850:PRINT" [217]OUR OPTIONS ARE:"
1090 PRINT" 1. [199]IVEN POINT & NORMAL, FIND PLANE"
1100 PRINT" 2. [199]IVEN 3 POINTS, FIND PLANE"
1110 PRINT" 3. [196]ISTANCE FROM A POINT TO A PLANE"
1120 PRINT" 4. [198]IND PLANE PASSING THROUGH 2 PTS"
1130 PRINT" AND PERPENDICULAR TO A GIVEN PLANE"
1140 PRINT" 5. [198]IND THE INTERSECTION OF 3 PLANES"
1150 PRINT" [197]NTER YOUR CHOICE(S): ";:US$="12345H":UL=5:GOSUB35:CH$=UR$
1160 QN=0:IFH<5THENH=5
1170 CH=0:FORI=1TOLEN(CH$):CH=CH+2^(VAL(MID$(CH$,I,1))):NEXT
1180 PRINT" [200]OW MANY QUESTIONS? ";:US$=L4$:GOSUB35:HM=VAL(UR$):IFHM=0THEN1180
1190 PRINT" [197]NTER LEVEL OF DIFFICULTY? ";:US$=L4$:GOSUB35:HN=VAL(UR$):GOSUB875
1200 H=INT(SQR(HN)):IFH<2THENH=2
1210 IFHN<2THENHN=2
1220 IFQN=HMTHEN2040
1230 QN=QN+1
1240 OP=1+INT(5*RND(1)):IF(2^OPANDCH)=0THEN1240
1250 ONOPGOTO1260,1270,1280,1290,1300
1260 GOSUB2110:GOSUB1960:FORI=1TO3:PRINT" "Q$(I):NEXT:GOSUB1980:GOSUB1990:GOTO1220
1270 GOSUB2140:GOSUB1960:FORI=1TO3:PRINT" "Q$(I):NEXT:GOSUB1980:GOSUB1990:GOTO1220
1280 GOSUB2210:GOSUB1960:FORI=2TO4:PRINT" "Q$(I):NEXT:GOSUB1980:GOSUB1990:GOTO1220
1290 GOSUB2250:GOSUB1960:FORI=1TO5:PRINT" "Q$(I):NEXT:GOSUB1980:GOSUB1990:GOTO1220
1300 GOSUB2310:GOSUB1960:FORI=2TO5:PRINT" "Q$(I):NEXT:GOSUB1980:GOSUB1990:GOTO1220
1310 GOSUB35
1320 RETURN
1480 L8=1:LN=1:US$="YNH":GOSUB35:A$=UR$:RETURN
1490 N1=ABS(N1):N2=ABS(N2):IFN2>N1THENCF=N1:N1=N2:N2=CF
1500 IFN1=0THENCF=1:RETURN
1510 IFN2=0THENCF=N1:RETURN
1520 CF=N1-N2*INT(N1/N2):N1=N2:N2=CF:GOTO1510
1530 A=FNR(H):B=FNR(H):C=FNR(H):D=FNR(H):X=A*A+B*B-C*C-D*D:Y=2*A*C-2*B*D
1540 Z=2*A*D+2*B*C:W=A*A+B*B+C*C+D*D:M(1)=X:M(2)=Y:M(3)=Z
1550 IFX*X+Y*Y+Z*Z=0THEN1530
1560 IFRND(1)<.2THENM(1)=Y:M(2)=X
1570 IFRND(1)<.2THENM(1)=Z:M(3)=X:M(2)=Y
1580 IFRND(1)<.2THENM(1)=Z:M(3)=Y:M(2)=X
1590 IFRND(1)<.2THENM(1)=X:M(3)=Y:M(2)=Z
1600 IFRND(1)<.2THENM(1)=Y:M(3)=X:M(2)=Z
1610 RETURN
1620 P=FNR(HN):Q=FNR(HN):R=FNR(HN):RETURN
1630 A=FNR(HN):B=FNR(HN):C=FNR(HN):IFA*A+B*B+C*C=0THEN1630
1640 RETURN
1650 N1=A:N2=B:GOSUB1490:N1=CF:N2=C:GOSUB1490:IFATHENCF=CF*SGN(A):GOTO1680
1660 IFBTHENCF=CF*SGN(B):GOTO1680
1670 CF=CF*SGN(C)
1680 A=A/CF:B=B/CF:C=C/CF:D=-A*P-B*Q-C*R:P$="":IFA=0ANDB=0THENC=1
1690 IFA=0ANDC=0THENB=1
1700 IFB=0ANDC=0THENA=1
1710 IFA=1THENP$="X":GOTO1730
1720 IFATHENP$=MID$(STR$(A),2)+"X"
1730 IFB=0THEN1780
1740 IFB=1THENP$=P$+"+Y":GOTO1780
1750 IFB>0THENP$=P$+"+"+MID$(STR$(B),2)+"Y":GOTO1780
1760 IFB=-1THENP$=P$+"-Y":GOTO1780
1770 P$=P$+STR$(B)+"Y"
1780 IFC=0THEN1830
1790 IFC=1THENP$=P$+"+Z":GOTO1830
1800 IFC>0THENP$=P$+"+"+MID$(STR$(C),2)+"Z":GOTO1830
1810 IFC=-1THENP$=P$+"-Z":GOTO1830
1820 P$=P$+STR$(C)+"Z"
1830 IFLEFT$(P$,1)="+"THENP$=MID$(P$,2)
1840 IFD=0THEN1870
1850 IFD>0THENP$=P$+"+"+MID$(STR$(D),2):GOTO1870
1860 P$=P$+STR$(D)
1870 P$=P$+"=0":RETURN
1880 IFN1<0THENV$="("+STR$(N1)+","
1890 IFN1>=0THENV$="("+MID$(STR$(N1),2)+","
1900 IFN2<0THENV$=V$+STR$(N2)+","
1910 IFN2>=0THENV$=V$+MID$(STR$(N2),2)+","
1920 IFN3<0THENV$=V$+STR$(N3)+")"
1930 IFN3>=0THENV$=V$+MID$(STR$(N3),2)+")"
1940 RETURN
1950 A=V2*V6-V3*V5:B=V3*V4-V1*V6:C=V1*V5-V2*V4:RETURN
1960 UP=QN-1:UG$="[209]UESTION #":GOSUB850
1970 RETURN
1980 PRINT" [193]NSWER: ";:US$=L4$+"+-=XYZ(),":UL=17:GOTO1310
1990 IFUR$=P$THENPRINT" [210]IGHT!":NC=1+NC:GOTO2010
2000 PRINT" [215]RONG! [212]HE CORRECT ANSWER IS ":PRINT" ";P$
2010 GOSUB835
2030 RETURN
2040 UG$="[211]UMMARY":UH=1:UP=0:GOSUB850:PRINTTAB(16);"[208]LANES":PRINT" [207]PTION(S): "CH$
2050 PRINT" [207]UT OF";HM;"QUESTIONS,":PRINT" YOU CORRECTLY ANSWERED";NC
2060 NC=NC*100/HM:W=INT(10*NC+.5)/10
2070 PRINT" [212]HAT'S ";:IFW<>NCTHENPRINT"ABOUT ";
2080 PRINT""MID$(STR$(W),2)"%"
2090 PRINT" [196]O YOU WANT ANOTHER DRILL? ";:GOSUB1480:IFA$="Y"THEN1020
2100 RETURN
2110 GOSUB1620:N1=P:N2=Q:N3=R:GOSUB1880
2120 Q$(2)="PASSING THROUGH THE POINT "+V$:GOSUB1630:N1=A:N2=B:N3=C:GOSUB1880
2130 Q$(3)="WITH "+V$+" AS NORMAL VECTOR":GOTO1650
2140 Q$(2)="WHICH PASSES THROUGH THE POINTS"
2150 GOSUB1620:N1=P:N2=Q:N3=R:GOSUB1880:Q$(3)=V$:V1=P:V2=Q:V3=R
2160 GOSUB1620:N1=P:N2=Q:N3=R:GOSUB1880:Q$(3)=Q$(3)+", "+V$:V4=P:V5=Q:V6=R
2170 GOSUB1620:N1=P:N2=Q:N3=R:GOSUB1880:Q$(3)=Q$(3)+", "+V$
2180 V1=V1-P:V2=V2-Q:V3=V3-R:V4=V4-P:V5=V5-Q:V6=V6-R:GOSUB1950
2190 IFA*A+B*B+C*C=0THEN2140
2200 GOTO1650
2210 Q$(2)="[198]IND THE DISTANCE":Q$(3)="FROM THE POINT ":Q$(4)="TO THE PLANE "
2220 GOSUB1530:GOSUB1620:N1=M(1)+P:N2=M(2)+Q:N3=M(3)+R:GOSUB1880
2230 Q$(3)=Q$(3)+V$:A=M(1):B=M(2):C=M(3):GOSUB1650:Q$(4)=Q$(4)+P$
2240 P$=MID$(STR$(W),2):RETURN
2250 Q$(2)="PASSING THROUGH THE POINTS":Q$(4)="AND PERPENDICULAR TO THE PLANE
2260 [141]1630:[141]1620:[141]1650:Q$(5)[178]P$:V1[178]A:V2[178]B:V3[178]C:[141]1620
2270 N1[178]P:N2[178]Q:N3[178]R:[141]1880:Q$(3)[178]V$:[141]1620:V4[178]N1[171]P:V5[178]N2[171]Q:V6[178]N3[171]R
2280 N1[178]P:N2[178]Q:N3[178]R:[141]1880:Q$(3)[178]Q$(3)[170]" & "[170]V$:[141]1950
2290 [139]A[172]A[170]B[172]B[170]C[172]C[178]0[167]2260
2300 [137]1650
2310 Q$(2)[178]"ASCIND THE POINT OF INTERSECTION OF:"
2320 [141]1620:N1[178]P:N2[178]Q:N3[178]R:[141]1880
2330 [141]1630:[141]1650:Q$(3)[178]P$:V1[178]A:V2[178]B:V3[178]C:[141]1630:[141]1650:Q$(4)[178]P$
2340 V4[178]A:V5[178]B:V6[178]C:[141]1630:[141]1650:Q$(5)[178]P$:N1[178]A:N2[178]B:N3[178]C
2350 [141]1950:[139]A[172]N1[170]B[172]N2[170]C[172]N3[178]0[167]2320
2360 P$[178]V$:[142]